import { DependencyList, EffectCallback, useEffect, useRef } from "react";

export const useWatch = (effect: EffectCallback, deps?: DependencyList) => {
    const haveMount = useRef(false);
    useEffect(() => {
        if (haveMount.current) {
            effect();
        } else {
            haveMount.current = true;
        }
    }, deps);
};
